package com.grgbanking.it.system.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;


/**
 * 传到微信的部门结构
 * 
 * WXDepartment
 * 
 * @author 潘广伟
 * @Email p_3er@qq.com
 * @Date 2014-11-4 下午1:24:12
 * 
 * @version 1.0.0
 *
 */
@Entity
@Table(name = "wx_department", catalog = "it_system")
public class WXDepartment implements java.io.Serializable{
	private Integer id;
	private String name;
	private String parentid;
	private Integer wxId;
	private Integer departmentId;
	
	public WXDepartment(){
	}
	
	public WXDepartment(Department department){
		if(department.getWxId() != null){
			this.setId(department.getWxId());
		}
		this.setName(department.getDeptName());
		this.setParentid(department.getWxParentId().toString());
	}

	@Transient
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Transient
	public String getParentid() {
		return parentid;
	}

	public void setParentid(String parentid) {
		this.parentid = parentid;
	}
	
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "wxId")
	public Integer getWxId() {
		return wxId;
	}

	public void setWxId(Integer wxId) {
		this.wxId = wxId;
	}

	@Column(name = "departmentId")
	public Integer getDepartmentId() {
		return departmentId;
	}

	public void setDepartmentId(Integer departmentId) {
		this.departmentId = departmentId;
	}
	
	

}
